package cn.hit.tianqiao.service.impl;

import cn.hit.tianqiao.dao.FoodDao;
import cn.hit.tianqiao.dao.impl.FoodDaoImpl;
import cn.hit.tianqiao.domain.Food;
import cn.hit.tianqiao.service.FoodService;

import java.util.Collections;
import java.util.List;

public class FoodServiceImpl implements FoodService {
    FoodDao dao = new FoodDaoImpl();

    @Override
    public List<Food> findFoodsWithinDistance(double longitude, double latitude, double distance) {
        return dao.findWithinDistance(longitude, latitude, distance);
    }

    @Override
    public List<Food> findRecommendFoods(double longitude, double latitude, double distance) {
        return dao.findBySortedDistance(longitude, latitude, distance);
    }
}
